/* 基于局域网的视频网站系统 - 通用样式 */

/* 重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 基础样式 */
body {
    font-family: 'Microsoft YaHei', 'Roboto', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #333333;
    background-color: #F7F9FC;
}

/* 色彩变量 */
:root {
    --primary-color: #2E86AB;
    --admin-color: #1A535C;
    --teacher-color: #4ECDC4;
    --student-color: #FFE66D;
    --neutral-light: #F7F9FC;
    --neutral-dark: #333333;
    --success-color: #4CAF50;
    --error-color: #FF6B6B;
    --warning-color: #FFA726;
    --border-color: #E0E0E0;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* 退出登录按钮样式 */
.logout-btn {
    background: linear-gradient(135deg, #FF6B6B 0%, #FF5252 100%);
    border: none;
    border-radius: 6px;
    color: white;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 16px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(255, 107, 107, 0.3);
    position: relative;
    overflow: hidden;
}

.logout-btn:hover {
    background: linear-gradient(135deg, #FF5252 0%, #FF1744 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(255, 107, 107, 0.4);
}

.logout-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(255, 107, 107, 0.3);
}

.logout-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.logout-btn:hover::before {
    left: 100%;
}

/* 布局容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.container-fluid {
    width: 100%;
    padding: 0 20px;
}

/* 网格系统 */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px;
}

.col {
    flex: 1;
    padding: 0 10px;
}

.col-1 { flex: 0 0 8.333333%; }
.col-2 { flex: 0 0 16.666667%; }
.col-3 { flex: 0 0 25%; }
.col-4 { flex: 0 0 33.333333%; }
.col-6 { flex: 0 0 50%; }
.col-8 { flex: 0 0 66.666667%; }
.col-9 { flex: 0 0 75%; }
.col-12 { flex: 0 0 100%; }

/* 卡片组件 */
.card {
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    overflow: hidden;
}

.card-header {
    padding: 16px 20px;
    background: var(--neutral-light);
    border-bottom: 1px solid var(--border-color);
    font-weight: bold;
    font-size: 16px;
}

.card-body {
    padding: 20px;
}

.card-footer {
    padding: 16px 20px;
    background: var(--neutral-light);
    border-top: 1px solid var(--border-color);
}

/* 按钮组件 */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    line-height: 1.5;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.btn-primary {
    background-color: var(--primary-color);
    color: #000000;
    font-weight: 600;
}

.btn-primary:hover {
    background-color: #1e5f7a;
    color: #000000;
}

.btn-admin {
    background-color: var(--admin-color);
    color: white;
}

.btn-admin:hover {
    background-color: #0f3a42;
}

.btn-teacher {
    background-color: var(--teacher-color);
    color: white;
}

.btn-teacher:hover {
    background-color: #3bb5ad;
}

.btn-student {
    background-color: var(--student-color);
    color: #333;
}

.btn-student:hover {
    background-color: #f5d547;
}

.btn-success {
    background-color: var(--success-color);
    color: #000000;
    font-weight: 600;
}

.btn-success:hover {
    background-color: #45a049;
    color: #000000;
}

.btn-danger {
    background-color: var(--error-color);
    color: white;
}

.btn-danger:hover {
    background-color: #e55a5a;
}

.btn-secondary {
    background-color: #999999;
    color: white;
}

.btn-secondary:hover {
    background-color: #808080;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 16px;
}

/* 表单组件 */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--neutral-dark);
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(46, 134, 171, 0.2);
}

.form-control.is-invalid {
    border-color: var(--error-color);
}

.form-control.is-valid {
    border-color: var(--success-color);
}

.form-text {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
}

.form-check {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.form-check-input {
    margin-right: 8px;
}

/* 表格组件 */
.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.table th,
.table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    background-color: var(--neutral-light);
    font-weight: 600;
    color: var(--neutral-dark);
}

.table tbody tr:hover {
    background-color: #f8f9fa;
}

/* 导航组件 */
.navbar {
    background: white;
    box-shadow: var(--shadow);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-brand {
    font-size: 18px;
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
    padding: 16px 20px;
    display: inline-block;
}

.navbar-nav {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.navbar-nav .nav-item {
    margin: 0;
}

.navbar-nav .nav-link {
    display: block;
    padding: 16px 20px;
    color: var(--neutral-dark);
    text-decoration: none;
    transition: all 0.3s ease;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    background-color: var(--primary-color);
    color: white;
}

/* 侧边栏 */
.sidebar {
    width: 250px;
    background: white;
    box-shadow: var(--shadow);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 999;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 20px;
    background: var(--primary-color);
    color: white;
    text-align: center;
}

.sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav .nav-item {
    border-bottom: 1px solid var(--border-color);
}

.sidebar-nav .nav-link {
    display: block;
    padding: 16px 20px;
    color: var(--neutral-dark);
    text-decoration: none;
    transition: all 0.3s ease;
}

.sidebar-nav .nav-link:hover,
.sidebar-nav .nav-link.active {
    background-color: var(--primary-color);
    color: white;
}

.sidebar-nav .nav-link i {
    margin-right: 10px;
    width: 16px;
}

/* 主内容区 */
.main-content {
    margin-left: 250px;
    min-height: 100vh;
    background: var(--neutral-light);
}

.content-wrapper {
    padding: 20px;
}

/* 页面标题 */
.page-header {
    margin-bottom: 30px;
}

.page-title {
    font-size: 24px;
    font-weight: bold;
    color: var(--neutral-dark);
    margin-bottom: 8px;
}

.page-subtitle {
    color: #666;
    font-size: 14px;
}

/* 统计卡片 */
.stats-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: transform 0.3s ease;
}

.stats-card:hover {
    transform: translateY(-2px);
}

.stats-number {
    font-size: 32px;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.stats-label {
    color: #666;
    font-size: 14px;
}

/* 状态标签 */
.badge {
    display: inline-block;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 12px;
    text-align: center;
}

.badge-success {
    background-color: var(--success-color);
    color: white;
}

.badge-warning {
    background-color: var(--warning-color);
    color: white;
}

.badge-danger {
    background-color: var(--error-color);
    color: white;
}

.badge-secondary {
    background-color: #999;
    color: white;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-dialog {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 18px;
    font-weight: bold;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
}

.modal-close:hover {
    color: var(--error-color);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* 提示组件 */
.alert {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 16px;
    border: 1px solid transparent;
}

.alert-success {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.alert-danger {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.alert-warning {
    background-color: #fff3cd;
    border-color: #ffeaa7;
    color: #856404;
}

.alert-info {
    background-color: #d1ecf1;
    border-color: #bee5eb;
    color: #0c5460;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    position: relative;
}

.loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 2px solid transparent;
    border-top: 2px solid var(--primary-color);
    border-right: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: calc(100% - 4px);
    height: calc(100% - 4px);
    border: 2px solid transparent;
    border-bottom: 2px solid var(--teacher-color);
    border-left: 2px solid var(--teacher-color);
    border-radius: 50%;
    animation: spin 1.5s linear infinite reverse;
}

/* 脉冲加载动画 */
.loading-pulse {
    display: inline-block;
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 50%;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.2);
        opacity: 1;
    }
    100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
}

/* 波浪加载动画 */
.loading-wave {
    display: inline-block;
    width: 20px;
    height: 20px;
    position: relative;
}

.loading-wave::before,
.loading-wave::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--primary-color);
    animation: wave 1.5s ease-in-out infinite;
}

.loading-wave::after {
    animation-delay: -0.75s;
}

@keyframes wave {
    0%, 100% {
        transform: scale(0);
        opacity: 1;
    }
    50% {
        transform: scale(1);
        opacity: 0;
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 工具类 */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.p-1 { padding: 8px; }
.p-2 { padding: 16px; }
.p-3 { padding: 24px; }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-inline-block { display: inline-block; }

.justify-content-between { justify-content: space-between; }
.justify-content-center { justify-content: center; }
.align-items-center { align-items: center; }

.w-100 { width: 100%; }
.h-100 { height: 100%; }

/* 响应式设计 */
@media (max-width: 1199px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .sidebar-toggle {
        display: block;
    }
}

@media (max-width: 767px) {
    .container {
        padding: 0 10px;
    }
    
    .content-wrapper {
        padding: 10px;
    }
    
    .col-6 {
        flex: 0 0 100%;
    }
    
    .modal-dialog {
        width: 95%;
        margin: 10px;
    }
}

/* 隐藏侧边栏切换按钮（默认隐藏） */
.sidebar-toggle {
    display: none;
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1001;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 10px;
    border-radius: 4px;
    cursor: pointer;
}

/* 视频播放器样式 */
.video-player {
    width: 100%;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}

.video-player video {
    width: 100%;
    height: auto;
}

/* 视频卡片 */
.video-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease;
}

.video-card:hover {
    transform: translateY(-2px);
}

.video-thumbnail {
    width: 100%;
    height: 200px;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 48px;
}

.video-info {
    padding: 16px;
}

.video-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--neutral-dark);
}

.video-meta {
    font-size: 12px;
    color: #666;
    margin-bottom: 4px;
}

/* 考试相关样式 */
.exam-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
    transition: transform 0.3s ease;
}

.exam-card:hover {
    transform: translateY(-2px);
}

.exam-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 8px;
    color: var(--neutral-dark);
}

.exam-meta {
    font-size: 14px;
    color: #666;
    margin-bottom: 12px;
}

.exam-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

/* 题目样式 */
.question-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.question-content {
    font-size: 16px;
    margin-bottom: 16px;
    line-height: 1.6;
}

.question-options {
    list-style: none;
    padding: 0;
}

.question-options li {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.question-options li:last-child {
    border-bottom: none;
}

.option-label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.option-label input[type="radio"] {
    margin-right: 10px;
}

/* 进度条 */
.progress {
    width: 100%;
    height: 8px;
    background-color: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

/* 搜索框 */
.search-box {
    position: relative;
    margin-bottom: 20px;
}

.search-box input {
    width: 100%;
    padding: 12px 40px 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 25px;
    font-size: 14px;
}

.search-box .search-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

.pagination li {
    margin: 0 4px;
}

.pagination a {
    display: block;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--neutral-dark);
    text-decoration: none;
    transition: all 0.3s ease;
}

.pagination a:hover,
.pagination .active a {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}
